package com.alon.spring01.service.impl;

import com.alon.spring01.mapper.CountryMapper;
import com.alon.spring01.model.Country;
import com.alon.spring01.service.CountryService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: spring01
 * @description: 实现类
 * @author: yulongguang
 * @create: 2019-04-07 14:22
 **/
@Service
public class CountryServiceImpl implements CountryService {
    @Autowired
    private CountryMapper countryMapper;
    @Override
    public PageInfo<Country> findwithPage(int page, int pageSize) {

        return PageHelper.startPage(page, pageSize).doSelectPageInfo(()->countryMapper.find());
    }
}
